home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / STREAMS.PAK / STREAM3.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  642b  |  34 lines

  1. // ---------------------------------------------------------------------------
  2. // Copyright (C) 1994 Borland International
  3. //  stream3.cpp
  4. //    Must link with strmpnt.cpp
  5. // ---------------------------------------------------------------------------
  6.  
  7. #include "strmpnt.h"
  8.  
  9. const char* FileName = "stream.dat";
  10.  
  11. void WriteStream()
  12. {
  13.     ofpstream ofp(FileName);
  14.     T3DPoint p3(7,9,11);
  15.     ofp << &p3;
  16. }
  17.  
  18. void ReadStream()
  19. {
  20.     ifpstream ifp(FileName);
  21.     T3DPoint* p3 = 0;
  22.     ifp >> p3;
  23.     if( p3 )
  24.         p3->Draw();
  25.     delete p3;
  26. }
  27.  
  28. int main()
  29. {
  30.     WriteStream();
  31.     ReadStream();
  32.     return 0;
  33. }
  34.